package com.xhwy.param;

import javax.validation.constraints.NotNull;

/**
 * 商品查询参数实体
 */
public class ProductQueryParam {

    private String keyword;   //搜索关键词

    private String productTypeId;   //商品类型编号

    @NotNull
    private Integer currentPage;//当前页
    @NotNull
    private Integer pageSize;//每页记录数

    private Integer offset;

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getProductTypeId() {
        return productTypeId;
    }

    public void setProductTypeId(String productTypeId) {
        this.productTypeId = productTypeId;
    }

    public Integer getCurrentPage() {
        return currentPage;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getOffset() {
        return this.offset = (this.currentPage - 1) * this.pageSize;
    }

    public void setOffset(Integer offset) {
        this.offset = offset;
    }

    @Override
    public String toString() {
        return "ProductQueryParam{" +
                "keyword='" + keyword + '\'' +
                ", productTypeId='" + productTypeId + '\'' +
                ", currentPage=" + currentPage +
                ", pageSize=" + pageSize +
                ", offset=" + offset +
                '}';
    }
}
